package jike.demo25;

import java.util.concurrent.TimeUnit;

/**
 * @author oyz
 */
public class UserController {

    private Metrics metrics = new Metrics();


    public UserController() {
        metrics.startRepeatedReport(60, TimeUnit.SECONDS);
    }

    public void login(String username, String password) {
        long startTimestamp = System.currentTimeMillis();
        metrics.recordTimestamp("login", startTimestamp);
        long respTime = System.currentTimeMillis() - startTimestamp;
        metrics.recordResponseTime("login", respTime);
    }

}
